This example is SimpleText 1.4d16. It's the same source that Apple's building (at least as I write this). We decided that enough developers had asked for SimpleText source so it was time to actually release it. Note that this code is copyright Apple Computer. The standard disclaimers apply. Here's the copyright information again for your reading enjoyment:
You may incorporate this sample code into your applications without restriction, though the sample code has been provided "AS IS" and the responsibility for its operation is 100% yours. However, what you are not permitted to do is to redistribute the source as "DSC Sample Code" after having made changes. If you're going to re-distribute the source, we require that you make it clear in the source that the code was descended from Apple Sample Code, but that you've made changes.
Build notes:
The CodeWarrior projects are in the CW BuildFolder folder. There are a few things to note when building SimpleText with CodeWarrior. The first is that there is the "TextFile.a.o" file, which is built from the TextFile.a source. Since CodeWarrior doesn't have an assembler, this file has been assembled with MPW asm and is included in the CW Build Folder. There are also three libraries which are included (AGFileLib.o, AGFileLib.xcoff and AppleGuideGlue.xcoff) which are also in the AppleGuide SDK, but are included with the project for your convenience.
SimpleText also uses the Universal Headers 3.0. The portion of the note that originally accompanied them that talks about the interfaces is included below. You can continue to use the libraries that accompany your development environment for linking.
Interfaces & Libraries
Interfaces
The interface files on WWDC '96 CD are version 3.0d3. This is the first general release of the Universal Interfaces 3.0 series. The 3.0 series interfaces will support developing code targeted for Mac OS 8 or System 7. Unlike previous interface files, the 3.0 series interfaces contain conditionals which allow a developer to specify the target OS. Only declarations applicable to that runtime are seen by the compiler. When compiling, a developer should specify one of the following:
BUILDING_FOR_SYSTEM7 - Code is intended to run on System 7.x machine or earlier.
BUILDING_FOR_SYSTEM7_AND_SYSTEM8 - Code is intended to run on System 7 or Mac OS 8 (default),
BUILDING_FOR_SYSTEM8 - Code is intended to run on Mac OS 8 only.
BUILDING_PREEMPTIVE_CODE - Code is intended to run as Mac OS 8 server or driver.
With MPW tools, the flag will usually be specified on the command line (e.g. MrC -d BUILDING_FOR_SYSTEM8). In other development environments, the flag can be specified in a common include file compiled before any system interfaces is compiled (e.g. #define BUILDING_FOR_SYSTEM8 1). If no flag is specified, BUILDING_FOR_SYSTEM7_AND_SYSTEM8 is assumed. Please see at ConditionalMacros.h for more details.
Changes since version 1.3.1:
The changes (in last to first order) since version 1.3.1 are listed below.
fixed bug relating to disabling of menus during print
native/FAT version now
fixed some bugs having to do with menu adjusting and hilighting.
AppleGuide 2.x support
converted to D11 headers, new SC compiler
open 'ttro' documents read only even first time
support for high res PICTs displaying correctly sized
optimized scrolling of PICTs in ttro files
form feed support for text doc printing
fixed text rotation hilight in PDDs
annotation in PDDs first implementation
support for new "Contents" menu
implemented movable modal dialog boxes
select all turns into select none
implementing PDD find autoscroll
find now working for PDDs, minus wrap and autoscroll
fixed 1272735, page down key wrapping
started find dialog work for PDDs
PICT files now support drag out
PDDs support Copy, drag out
PDDs now support selection, fixed some bugs in zooming
text documents now have undo, fixed a minor bug in find
PDDs now have better page browsing, proxy support, and zooming.
now always respect stationary bit (112137)
UpdateResFile() on save of text doc (1246237)
increased RAM for new document to 64k (1249917)
added find/replace for text documents
added GX style font menu
added support for next page/prev page for text windows
added support for all 3d button types
disabled drag and drop for 3d views, as we don't allow edit